﻿using System.Collections.Generic;
using System.Runtime.Serialization;

namespace Ndex.Core.Service
{
    [DataContract]
    public class ServiceRequest : ServiceMessage
    {
        [DataMember]
        public long UserId { get; set; }
        
        [DataMember]
        public long ApplicationId { get; set; }

        public ServiceRequest() 
        { 
            UserId = 0;
            ApplicationId = 0;
        }

        public virtual List<ValidationModel> Validate()
        {
            var result = new List<ValidationModel>();
            result.Add("Application Id is required", "ApplicationId", ApplicationId);
            return result;
        }

        public override string ToString()
        {
            return string.Format("Request {0} From Application ID {1}, User ID {2}", Id, ApplicationId, UserId);
        }
    }
}
